package com.shelpe.services.lexicon.service.tag;

import org.springframework.stereotype.Service;

import com.shelpe.services.lexicon.entity.KeywordRecommend;
import com.shelpe.services.lexicon.entity.KeywordTag;

@Service
/**
 * 移动包规则
 * @author Otis
 *
 */
public class MobileRecommendTagRule implements RecommendTagRule {
	
	@Override
	public KeywordTag tag(KeywordRecommend word,TagRuleContext context) {
		KeywordTag tag = null;
		
		boolean satisfied = false;
		
		if(word.getMobileInsight() != null && word.getMobileInsight().getImpression() > 0){
			satisfied = true;
		}
		
		if(satisfied){
			tag = new KeywordTag();
			tag.setTagID(4);
			tag.setTagName("mobile");
		}
		return tag;
	}

	
}
